using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableWorldBossStrongholdStyleDao:DaoBase<TableWorldBossStrongholdStyle>
    {
        public override void AddPrimaryIndex(TableWorldBossStrongholdStyle model)
        {
            cachePrimary[model.StrongholdStyleId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableWorldBossStrongholdStyle.txt";
        }

        protected override TableWorldBossStrongholdStyle ParseRowData(string[] rowData)
        {
            TableWorldBossStrongholdStyle data = new TableWorldBossStrongholdStyle();
			data.StrongholdStyleId = rowData [0];
			data.ModelName = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.ModelScale = 0;
            }
            else
            {
                data.ModelScale = double.Parse(rowData[2]);
            }

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.ModelWidth = 0;
            }
            else
            {
                data.ModelWidth = double.Parse(rowData[3]);
            }

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.ModelLength = 0;
            }
            else
            {
                data.ModelLength = double.Parse(rowData[4]);
            }

            if (string.IsNullOrEmpty(rowData[5]))
            {
                data.ModelHeight = 0;
            }
            else
            {
                data.ModelHeight = double.Parse(rowData[5]);
            }
			data.LeftWeaponName = rowData [6];
			data.RightWeaponName = rowData [7];

            return data;
        }



    }

}
